<template>
  <div class="mutual-details">
    <!-- 基本信息区域 -->
    <div class="basic-info">
      <div class="title">{{ details.title }}</div>
      <div v-if="details.reviewStatus !== '1'" class="review-status-bar">
        <div class="status-info">
          <i :class="details.reviewStatus === '0' ? 'el-icon-loading' : 'el-icon-warning-outline'"></i>
          <span :class="{'status-pending': details.reviewStatus === '0', 'status-reject': details.reviewStatus === '2'}">
            {{ details.reviewStatus === '0' ? '合作审核中' : '合作审核未通过' }}
          </span>
          <el-button 
            v-if="details.reviewStatus === '2' && isMyCreated" 
            type="primary" 
            size="small" 
            @click="handleEdit"
          >修改内容</el-button>
        </div>
        <div v-if="details.reviewStatus === '2' && details.reviewNotes" class="reject-reason">
          未通过原因：{{ details.reviewNotes }}
        </div>
      </div>

      <div class="category-tag" v-if="details.demandCategory">
        <el-tag size="small" type="info">{{ details.demandCategory }}</el-tag>
      </div>
      
      <div class="info-row">
        <i class="el-icon-view"></i>
        <span>{{ details.heatValue || 0 }}</span>
        <i class="el-icon-thumb"></i>
        <span>{{ details.likeCount || 0 }}</span>
      </div>

      <div class="publisher-info">
        <div class="info-item">
          <i class="el-icon-user"></i>
          <span>{{ details.publisherName }}</span>
        </div>
        <el-tooltip 
          :content="details.currentResidence" 
          placement="top"
          :disabled="!details.currentResidence || details.currentResidence.length <= 3"
        >
          <div class="info-item">
            <i class="el-icon-location"></i>
            <span>{{ formatAddress(details.currentResidence) }}</span>
          </div>
        </el-tooltip>
        <div class="info-item">
          <i class="el-icon-time"></i>
          <span>{{ formatDate(details.createTime) }}</span>
        </div>
      </div>
    </div>

    <!-- 领域信息 -->
    <div class="field-info" v-if="details.priorityField || details.priorityDirection">
      <div class="section-title">领域信息</div>
      <div class="field-content">
        <div class="field-item" v-if="details.priorityField">
          <span class="label">优先领域</span>
          <span class="value">{{ details.priorityField }}</span>
        </div>
        <div class="field-item" v-if="details.priorityDirection">
          <span class="label">发展方向</span>
          <span class="value">{{ details.priorityDirection }}</span>
        </div>
      </div>
    </div>

    <!-- 详细描述 -->
    <div class="description-section">
      <div class="section-title">详细描述</div>
      <div class="description-content">{{ details.description }}</div>
    </div>

    <!-- 有效期 -->
    <div class="deadline-info">
      <i class="el-icon-timer"></i>
      <span>有效期至：{{ formatDate(details.effectiveDate) }}</span>
    </div>

    <!-- 报名人列表，仅在我创建的活动中显示 -->
    <div class="signup-list section" v-if="isMyCreated && details.needRegistration">
      <div class="section-title">
        <span>报名人列表</span>
        <el-tag size="small" type="primary">{{ signUpList.length }}人</el-tag>
      </div>
      
      <div class="list-content">
        <template v-if="signUpList.length > 0">
          <el-table
            :data="signUpList"
            style="width: 100%"
            :header-cell-style="{ background: '#f5f7fa' }"
            border
            @row-click="handleRowClick"
          >
            <el-table-column
              prop="signUpName"
              label="姓名"
              min-width="100"
              align="center"
            >
              <template slot-scope="scope">
                <div class="name-cell">
                  <span>{{ scope.row.signUpName }}</span>
                </div>
              </template>
            </el-table-column>
            
            <el-table-column
              prop="signUpContact"
              label="联系方式"
              min-width="140"
              align="center"
            >
              <template slot-scope="scope">
                <div class="contact-cell">
                  <i class="el-icon-phone"></i>
                  <el-tooltip 
                    :content="scope.row.signUpContact" 
                    placement="top"
                    :disabled="!scope.row.signUpContact"
                  >
                    <span>{{ scope.row.signUpContact || '暂无' }}</span>
                  </el-tooltip>
                </div>
              </template>
            </el-table-column>
            
            <el-table-column
              prop="signUpTime"
              label="报名时间"
              min-width="120"
              align="center"
            >
              <template slot-scope="scope">
                <div class="time-cell">
                  <i class="el-icon-time"></i>
                  <span>{{ formatSignUpTime(scope.row.signUpTime) }}</span>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </template>
        <el-empty 
          v-else 
          description="暂无报名" 
          :image-size="60"
        >
          <template slot="description">
            <p>暂无校友报名</p>
            <small style="color: #999; font-size: 12px;">分享给更多校友，让大家一起参与</small>
          </template>
        </el-empty>
      </div>
    </div>

    <!-- 底部操作栏 -->
    <div class="bottom-actions">
      <div class="action-group">
        <div class="action-item" @click="handleLike">
          <img :src="require(`@/assets/img/${details.likeStatus === '1' ? 'good1' : 'good'}.png`)" 
               class="icon-img" 
               alt="点赞">
          <span>点赞</span>
        </div>
        <div class="action-item" @click="handleCollect">
          <img :src="require(`@/assets/img/${details.collectionStatus === '1' ? 'collection1' : 'collection'}.png`)" 
               class="icon-img" 
               alt="收藏">
          <span>收藏</span>
        </div>
        <div class="action-item" @click="handleForward">
          <i class="el-icon-share"></i>
          <span>转发 {{ details.forwardCount || 0 }}</span>
        </div>
        <div class="action-item" @click="handleContact">
          <img src="@/assets/img/contact.png" class="icon-img" alt="联系">
          <span>联系</span>
        </div>
      </div>
      <div class="main-action">
        <template v-if="details.needRegistration">
          <template v-if="details.registrationStatus === '1'">
            <el-button 
              type="danger" 
              size="small"
              plain
              @click="handleCancelParticipation"
            >
              取消参与
            </el-button>
          </template>
          <el-button 
            v-else
            type="primary" 
            @click="handleParticipate"
          >
            立即参与
          </el-button>
        </template>
        <el-button v-else type="info" disabled>无需报名</el-button>
      </div>
    </div>

    <!-- 联系方式弹窗 -->
    <el-dialog
      title="联系方式"
      :visible.sync="contactDialogVisible"
      width="80%"
      custom-class="contact-dialog"
      :show-close="false"
      center>
      <div class="contact-content">
        <div class="contact-item">
          <span class="label">联系人</span>
          <span class="value">{{ details.publisherName }}</span>
        </div>
        <div class="contact-item">
          <span class="label">{{ details.contactType }}</span>
          <span class="value">{{ details.contactInfo }}</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="contactDialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>

    <!-- 校友详情弹窗 -->
    <el-dialog
      title="校友详情"
      :visible.sync="alumniDialogVisible"
      :width="isMobile ? '96%' : '90%'"
      custom-class="alumni-dialog"
      :close-on-click-modal="false"
    >
      <el-card v-if="alumniDetail" shadow="never" class="alumni-card">
        <!-- 基本信息 -->
        <div class="info-section">
          <div class="section-header">
            <i class="el-icon-user"></i>
            <span>基本信息</span>
          </div>
          <el-descriptions :column="isMobile ? 1 : 2" border>
            <el-descriptions-item label="姓名">
              {{ alumniDetail.name }}
            </el-descriptions-item>
            <el-descriptions-item label="性别">
              {{ alumniDetail.gender }}
            </el-descriptions-item>
            <el-descriptions-item label="入学年份">
              {{ alumniDetail.admissionYear }}
            </el-descriptions-item>
            <el-descriptions-item label="毕业年份">
              {{ alumniDetail.graduationYear }}
            </el-descriptions-item>
            <el-descriptions-item label="学院">
              {{ alumniDetail.college }}
            </el-descriptions-item>
            <el-descriptions-item label="专业">
              {{ alumniDetail.major }}
            </el-descriptions-item>
            <el-descriptions-item label="班级">
              {{ alumniDetail.classNo }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
        
        <!-- 联系方式 -->
        <div class="info-section">
          <div class="section-header">
            <i class="el-icon-phone"></i>
            <span>联系方式</span>
          </div>
          <el-descriptions :column="isMobile ? 1 : 2" border>
            <el-descriptions-item label="联系电话">
              <el-tag size="medium" type="info">
                {{ alumniDetail.contactInfo || '暂无' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="邮箱">
              <el-tag size="medium" type="info">
                {{ alumniDetail.email || '暂无' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="现居地">
              {{ alumniDetail.currentResidence || '暂无' }}
            </el-descriptions-item>
            <el-descriptions-item label="家乡">
              {{ alumniDetail.hometown || '暂无' }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </el-card>
      
      <div slot="footer" class="dialog-footer">
        <el-button @click="alumniDialogVisible = false">关 闭</el-button>
      </div>
    </el-dialog>

    <!-- 取消参与确认弹框 -->
    <el-dialog
      title="取消参与确认"
      :visible.sync="cancelDialogVisible"
      width="90%"
      custom-class="cancel-dialog"
      :show-close="false"
      center
    >
      <div class="cancel-content">
        <i class="el-icon-warning-outline warning-icon"></i>
        <div class="warning-text">
          <p class="title">确定要取消参与吗？</p>
          <p class="desc">取消后需要重新参与才能继续互助</p>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelDialogVisible = false">再想想</el-button>
        <el-button type="danger" @click="confirmCancel" :loading="cancelling">确定取消</el-button>
      </span>
    </el-dialog>

    <!-- 修改弹窗 -->
    <el-dialog
      title="修改互助信息"
      :visible.sync="editDialogVisible"
      width="85%"
      :before-close="handleDialogClose"
      custom-class="edit-dialog"
    >
      <div class="dialog-content">
        <div class="form-header">
          <i class="el-icon-edit"></i>
          <span>请修改以下信息</span>
        </div>
        
        <el-form 
          ref="editForm" 
          :model="editForm" 
          :rules="rules" 
          label-width="120px"
          size="small"
          class="edit-form"
        >
          <el-row :gutter="20">
            <el-col :span="16">
              <el-form-item label="标题" prop="title">
                <el-input 
                  v-model="editForm.title" 
                  placeholder="请输入标题"
                  prefix-icon="el-icon-edit"
                ></el-input>
              </el-form-item>
            </el-col>
            
            <el-col :span="8">
              <el-form-item label="需求类别" prop="demandCategory">
                <el-select 
                  v-model="editForm.demandCategory" 
                  placeholder="请选择需求类别"
                  style="width: 100%"
                >
                  <el-option 
                    v-for="item in demandCategories" 
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                    <i class="el-icon-collection-tag"></i>
                    <span>{{ item.label }}</span>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            
            <el-col :span="8">
              <el-form-item label="优先领域">
                <el-input 
                  v-model="editForm.priorityField" 
                  placeholder="请输入优先领域（选填）"
                  prefix-icon="el-icon-aim"
                ></el-input>
              </el-form-item>
            </el-col>
            
            <el-col :span="8">
              <el-form-item label="优先方向">
                <el-input 
                  v-model="editForm.priorityDirection" 
                  placeholder="请输入优先方向（选填）"
                  prefix-icon="el-icon-position"
                ></el-input>
              </el-form-item>
            </el-col>
            
            <el-col :span="8">
              <el-form-item label="有效期至" prop="effectiveDate">
                <el-date-picker
                  v-model="editForm.effectiveDate"
                  type="date"
                  placeholder="选择有效期"
                  value-format="yyyy-MM-dd"
                  style="width: 100%"
                  :picker-options="{
                    disabledDate(time) {
                      return time.getTime() < Date.now() - 8.64e7;
                    }
                  }"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            
            <el-col :span="24">
              <el-form-item label="详细描述" prop="description">
                <el-input 
                  type="textarea" 
                  v-model="editForm.description" 
                  :rows="6"
                  placeholder="请输入详细描述"
                  resize="none"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleDialogClose" size="small">取 消</el-button>
        <el-button 
          type="primary" 
          @click="submitEdit" 
          :loading="submitting"
          size="small"
        >确 定</el-button>
      </div>
    </el-dialog>

    <!-- 修改审批操作区域 -->
    <div v-if="isAudit" class="audit-actions">
      <div class="audit-form">
        <el-form :model="auditForm" ref="auditForm" :rules="auditRules" size="small">
          <el-form-item 
            prop="reasonForReview" 
            v-if="auditForm.examine === '2'"
          >
            <el-input
              type="textarea"
              v-model="auditForm.reasonForReview"
              placeholder="请输入不通过原因（必填）"
              :rows="3"
              resize="none"
              maxlength="200"
              show-word-limit
            ></el-input>
          </el-form-item>
          <div class="audit-buttons">
            <el-button 
              type="success" 
              plain
              icon="el-icon-check"
              @click="handleAudit('1')"
              :loading="auditing"
            >通过</el-button>
            <el-button 
              type="danger" 
              plain
              icon="el-icon-close"
              @click="handleAudit('2')"
              :loading="auditing"
            >不通过</el-button>
          </div>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import { 
  alumniMutualDetail, 
  alumniMutualLike,
  alumniFormCollect,
  alumniFormForward,
  alumniFormSignUp,
  alumniFormCancelSignUp,
  getMyAlumniFormSignUp,
  getAlumniDetail,
  updateMutual,
  mutualHandleForward,
  checkMutual
} from "@/api/api";

export default {
  data() {
    return {
      details: {},
      contactDialogVisible: false,
      signUpList: [],  // 新增报名列表数据
      isMyCreated: false,  // 新增是否是我创建的标记
      currentPage: 1,
      alumniDialogVisible: false,  // 校友详情弹窗显示状态
      alumniDetail: null,  // 校友详情数据
      isMobile: document.body.clientWidth < 768,
      cancelDialogVisible: false,
      cancelling: false,
      editDialogVisible: false,
      submitting: false,
      editForm: {
        id: '',
        title: '',
        demandCategory: '',
        description: '',
        priorityField: '',
        priorityDirection: '',
        effectiveDate: ''
      },
      demandCategories: [
        { label: '租房借房', value: '租房借房' },
        { label: '招聘求职', value: '招聘求职' },
        { label: '子女就学', value: '子女就学' },
        { label: '求医问药', value: '求医问药' },
        { label: '商业（资源）对接', value: '商业（资源）对接' },
        { label: '闲置交易', value: '闲置交易' }
      ],
      rules: {
        title: [
          { required: true, message: '请输入标题', trigger: 'blur' }
        ],
        demandCategory: [
          { required: true, message: '请选择需求类别', trigger: 'change' }
        ],
        description: [
          { required: true, message: '请输入详细描述', trigger: 'blur' }
        ],
        effectiveDate: [
          { required: true, message: '请选择有效期', trigger: 'change' }
        ]
      },
      forwarding: false,
      isAudit: false,
      auditing: false,
      auditForm: {
        examine: '',
        reasonForReview: ''
      },
      auditRules: {
        reasonForReview: [
          { required: true, message: '请输入不通过原因', trigger: 'blur' }
        ]
      }
    };
  },
  created() {
    document.title = "合作详情";
    this.isAudit = this.$route.query.isAudit == true;
    this.getDetail();
  },
  mounted() {
    window.addEventListener('resize', this.handleResize);
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.handleResize);
  },
  computed: {
    isActivityReviewPassed() {
      return this.details.reviewStatus === '1';
    },
    getRegistrationButtonText() {
      if (!this.isActivityReviewPassed) {
        return this.details.reviewStatus === '0' ? '合作审核中' : '合作审核未通过';
      }
      console.log(this.details)
      if (this.details.registrationStatus === '1') {
        return '已参与';
      }
      return '立即参与';
    }
  },
  methods: {
    formatDate(date) {
      if (!date) return '';
      const dt = new Date(date);
      const year = dt.getFullYear();
      const month = String(dt.getMonth() + 1).padStart(2, '0');
      const day = String(dt.getDate()).padStart(2, '0');
      return `${year}-${month}-${day}`;
    },
    formatAddress(address) {
      if (!address) return '';
      return address.length > 3 ? address.substring(0, 3) + '...' : address;
    },
    async getDetail() {
      try {
        const res = await alumniMutualDetail({
          id: this.$route.query.id
        });
        if (res.code === 200) {
          this.details = res.data;
          // 判断是否是我创建的活动
          this.isMyCreated = this.details.isCreator === '1';
          
          // 如果是我创建的活动，获取报名列表
          if (this.isMyCreated && this.details.needRegistration) {
            this.getSignUpList();
          }
        }
      } catch (error) {
        console.error('获取详情失败:', error);
        this.$message.error('获取详情失败');
      }
    },
    handleContact() {
      if (!this.isActivityReviewPassed) {
        this.$message.warning(
          this.details.reviewStatus === '0' 
            ? '合作正在审核中，暂时无法查看联系方式' 
            : '合作审核未通过，无法查看联系方式'
        );
        return;
      }
      
      if (this.details.contactInfo) {
        this.contactDialogVisible = true;
      } else {
        this.$message.info('暂无联系方式');
      }
    },
    async handleLike() {
      try {
        const params = {
          id: this.details.id
        }
        const res = await alumniMutualLike(params)
        
        if (res.success) {
          // 更新点赞状态
          this.details.likeStatus = this.details.likeStatus === '1' ? '0' : '1'
          // 更新点赞数量
          this.details.likeCount = this.details.likeStatus === '1' 
            ? Number(this.details.likeCount) + 1 
            : Number(this.details.likeCount) - 1
            
          this.$message({
            type: 'success',
            message: this.details.likeStatus === '1' ? '点赞成功' : '取消点赞成功'
          })
        }
      } catch (error) {
        console.error('点赞操作失败:', error)
        this.$message.error('操作失败，请稍后重试')
      }
    },
    async handleCollect() {
      try {
        const params = {
          id: this.details.id
        }
        const res = await alumniFormCollect(params)
        
        if (res.success) {
          // 更新收藏状态
          this.details.collectionStatus = this.details.collectionStatus === '1' ? '0' : '1'
          // 更新收藏数量
          this.details.collectionCount = this.details.collectionStatus === '1' 
            ? Number(this.details.collectionCount) + 1 
            : Number(this.details.collectionCount) - 1
            
          this.$message({
            type: 'success',
            message: this.details.collectionStatus === '1' ? '收藏成功' : '取消收藏成功'
          })
        }
      } catch (error) {
        console.error('收藏操作失败:', error)
        this.$message.error('操作失败，请稍后重试')
      }
    },
    async handleForward() {
      if (this.forwarding) return;
      
      try {
        this.forwarding = true;
        const res = await mutualHandleForward({
          id: this.details.id
        });
        
        if (res.code === 200) {
          // 创建临时输入框
          const input = document.createElement('input');
          input.value = res.data; // 接口返回的链接
          document.body.appendChild(input);
          
          // 选中并复制
          input.select();
          document.execCommand('copy');
          
          // 移除临时输入框
          document.body.removeChild(input);
          
          this.$message({
            type: 'success',
            message: '转发链接已复制到剪贴板！',
            duration: 2000
          });
          
          // 更新转发数
          this.details.forwardCount = (this.details.forwardCount || 0) + 1;
        } else {
          this.$message.error(res.message || '转发失败');
        }
      } catch (error) {
        console.error('转发失败:', error);
        this.$message.error('转发失败，请稍后重试');
      } finally {
        this.forwarding = false;
      }
    },
    async handleParticipate() {
      if (!this.isActivityReviewPassed) {
        this.$message.warning(
          this.details.reviewStatus === '0' 
            ? '合作正在审核中，暂时无法参与' 
            : '合作审核未通过，无法参与'
        );
        return;
      }

      if (this.details.registrationStatus === '1') {
        return;
      }

      try {
        const res = await alumniFormSignUp({
          id: this.details.id
        });
        
        if (res.success) {
          this.details.registrationStatus = '1';
          this.$message.success('参与成功');
          this.getDetail();
        }
      } catch (error) {
        console.error('参与失败:', error);
        this.$message.error('参与失败，请稍后重试');
      }
    },
    // 获取报名列表
    async getSignUpList() {
      try {
        const res = await getMyAlumniFormSignUp({
          id: this.$route.query.id
        });
        if (res.code === 200) {
          this.signUpList = res.data || [];
        }
      } catch (error) {
        console.error('获取报名列表失败:', error);
        this.$message.error('获取报名列表失败');
      }
    },
    // 格式化报名时间
    formatSignUpTime(time) {
      if (!time) return '';
      const date = new Date(time);
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, '0');
      const day = String(date.getDate()).padStart(2, '0');
      return `${year}-${month}-${day}`;
    },
    // 处理行点击事件
    async handleRowClick(row) {
      try {
        const res = await getAlumniDetail({
          id: row.signUpId
        });
        if (res.code === 200) {
          this.alumniDetail = res.data;
          this.alumniDialogVisible = true;
        }
      } catch (error) {
        console.error('获取校友详情失败:', error);
        this.$message.error('获取校友详情失败');
      }
    },
    handleResize() {
      this.isMobile = document.body.clientWidth < 768;
    },
    handleCancelParticipation() {
      this.cancelDialogVisible = true
    },
    async confirmCancel() {
      try {
        this.cancelling = true
        const res = await alumniFormCancelSignUp({
          id: this.details.id
        })
        
        if (res.code === 200) {
          this.$message.success('取消参与成功')
          this.cancelDialogVisible = false
          // 刷新详情数据
          this.getDetail()
        } else {
          this.$message.error(res.message || '取消参与失败')
        }
      } catch (error) {
        console.error('取消参与失败:', error)
        this.$message.error('取消参与失败，请稍后重试')
      } finally {
        this.cancelling = false
      }
    },
    handleEdit() {
      this.editForm = {
        id: this.details.id,
        title: this.details.title,
        demandCategory: this.details.demandCategory,
        description: this.details.description,
        priorityField: this.details.priorityField,
        priorityDirection: this.details.priorityDirection,
        effectiveDate: this.details.effectiveDate
      };
      this.editDialogVisible = true;
    },
    handleDialogClose() {
      if (this.$refs.editForm) {
        this.$refs.editForm.resetFields();
      }
      this.editDialogVisible = false;
    },
    async submitEdit() {
      try {
        await this.$refs.editForm.validate();
        this.submitting = true;
        
        const res = await updateMutual(this.editForm);
        
        if (res.code === 200) {
          this.$message.success('修改成功，请等待审核');
          this.editDialogVisible = false;
          this.getDetail(); // 刷新详情
        } else {
          this.$message.error(res.message || '修改失败');
        }
      } catch (error) {
        console.error('修改失败:', error);
        this.$message.error('表单验证失败，请检查填写的内容');
      } finally {
        this.submitting = false;
      }
    },
    async handleAudit(examine) {
      this.auditForm.examine = examine;
      
      if (examine === '2' && !this.auditForm.reasonForReview) {
        this.$refs.auditForm.validate(async (valid) => {
          if (!valid) return;
        });
        return;
      }
      
      try {
        this.auditing = true;
        const res = await checkMutual({
          id: this.details.id,
          examine: examine,
          reasonForReview: this.auditForm.reasonForReview
        });
        
        if (res.code === 200) {
          this.$message.success('审批成功');
          // 返回上一页
          this.$router.go(-1);
        } else {
          this.$message.error(res.message || '审批失败');
        }
      } catch (error) {
        console.error('审批失败:', error);
        this.$message.error('审批失败，请稍后重试');
      } finally {
        this.auditing = false;
      }
    }
  },
};
</script>

<style lang="less" scoped>
.mutual-details {
  min-height: 100vh;
  background: #f5f7fa;
  padding-bottom: 60px;

  .basic-info {
    background: #fff;
    padding: 20px;
    margin-bottom: 10px;

    .title {
      font-size: 18px;
      font-weight: 500;
      color: #333;
      margin-bottom: 12px;
    }

    .review-status-bar {
      margin: 12px 0;
      padding: 12px;
      background-color: #fef0f0;
      border-radius: 4px;
      border: 1px solid #fde2e2;

      .status-info {
        display: flex;
        align-items: center;
        gap: 12px;
        
        i {
          font-size: 16px;
          
          &.el-icon-loading {
            color: #e6a23c;
          }
          
          &.el-icon-warning-outline {
            color: #f56c6c;
          }
        }

        .status-pending {
          color: #e6a23c;
          font-weight: 500;
        }

        .status-reject {
          color: #f56c6c;
          font-weight: 500;
        }

        .el-button {
          margin-left: auto;
        }
      }

      .reject-reason {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #fde2e2;
        color: #f56c6c;
        font-size: 14px;
        line-height: 1.4;
      }
    }

    .info-row {
      display: flex;
      align-items: center;
      gap: 16px;
      margin: 12px 0;
      color: #666;
    }

    .publisher-info {
      display: flex;
      gap: 16px;
      color: #999;
      font-size: 13px;

      .info-item {
        display: flex;
        align-items: center;
        gap: 4px;
      }
    }
  }

  .field-info, .description-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 10px;

    .section-title {
      font-size: 16px;
      font-weight: 500;
      color: #333;
      margin-bottom: 16px;
      position: relative;
      padding-left: 10px;

      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 16px;
        background: #4790ff;
        border-radius: 1.5px;
      }
    }

    .field-content {
      .field-item {
        display: flex;
        margin-bottom: 12px;

        .label {
          width: 80px;
          color: #666;
        }

        .value {
          flex: 1;
          color: #333;
        }
      }
    }

    .description-content {
      color: #666;
      line-height: 1.6;
    }
  }

  .deadline-info {
    background: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f56c6c;
    font-size: 14px;
  }

  .signup-list {
    background: #fff;
    margin: 10px 0;
    border-radius: 8px;
    
    .section-title {
      display: flex;
      align-items: center;
      padding: 15px 20px;
      border-bottom: 1px solid #eee;
      
      span {
        font-size: 16px;
        font-weight: 500;
        color: #333;
        margin-right: 10px;
      }
      
      .el-tag {
        margin-left: 8px;
      }
    }
    
    .list-content {
      padding: 15px 20px;
      
      :deep(.el-table) {
        margin-bottom: 0;
        
        // 添加表格边框和hover效果
        &.el-table--border {
          border-radius: 4px;
          overflow: hidden;
        }
        
        .el-table__row:hover {
          background-color: #f5f7fa;
        }
        
        // 优化表头样式
        .el-table__header-wrapper {
          th {
            background: #f5f7fa;
            color: #333;
            font-weight: 500;
            height: 50px;
          }
        }
        
        // 优化单元格样式
        .el-table__cell {
          padding: 12px 0;
        }
        
        .name-cell {
          display: flex;
          align-items: center;
          gap: 8px;
          
          .el-avatar {
            background: #e6f1fc;
            color: #409eff;
          }
          
          span {
            color: #333;
            font-weight: 500;
          }
        }
        
        .contact-cell {
          display: flex;
          align-items: center;
          gap: 4px;
          color: #666;
          
          i {
            color: #409eff;
            font-size: 14px;
          }
          
          span {
            &:hover {
              color: #409eff;
              cursor: pointer;
            }
          }
        }
        
        .time-cell {
          display: flex;
          align-items: center;
          gap: 4px;
          color: #666;
          
          i {
            color: #909399;
          }
        }
      }
    }
  }

  .bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);

    .action-group {
      display: flex;
      gap: 20px;

      .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        cursor: pointer;

        .icon-img {
          width: 20px;
          height: 20px;
        }

        span {
          font-size: 12px;
          color: #666;
        }
      }
    }

    .main-action {
      .el-button {
        padding: 10px 24px;
        font-size: 14px;
      }
    }
  }

  // 弹窗样式
  :deep(.contact-dialog) {
    border-radius: 8px;
    
    .el-dialog__header {
      padding: 15px;
      text-align: center;
      border-bottom: 1px solid #eee;
    }
    
    .contact-content {
      .contact-item {
        display: flex;
        align-items: center;
        padding: 10px 0;
        
        &:not(:last-child) {
          border-bottom: 1px solid #f5f5f5;
        }
        
        .label {
          width: 80px;
          color: #999;
        }
        
        .value {
          flex: 1;
          color: #333;
          font-weight: 500;
        }
      }
    }
  }

  :deep(.alumni-dialog) {
    @media screen and (max-width: 768px) {
      .el-dialog {
        margin-top: 10vh !important;
      }
      
      .el-dialog__header {
        padding: 12px 15px;
        
        .el-dialog__title {
          font-size: 15px;
        }
      }
      
      .el-dialog__body {
        padding: 15px;
      }
      
      .alumni-card {
        .info-section {
          margin-bottom: 20px;
          
          .section-header {
            margin-bottom: 12px;
            
            i {
              font-size: 16px;
            }
            
            span {
              font-size: 15px;
            }
          }
        }
        
        :deep(.el-descriptions) {
          .el-descriptions-item__label {
            width: 80px;
            padding: 8px 10px;
            font-size: 13px;
          }
          
          .el-descriptions-item__content {
            padding: 8px 10px;
            font-size: 13px;
            
            .el-tag {
              font-size: 12px;
              height: 24px;
              line-height: 22px;
            }
          }
        }
      }
      
      .dialog-footer {
        padding: 10px 15px;
        
        .el-button {
          padding: 8px 15px;
          font-size: 13px;
        }
      }
    }
  }
  
  :deep(.el-table) {
    tbody tr {
      cursor: pointer;
      
      &:hover {
        background-color: #f5f7fa;
      }
    }
  }

  .cancel-dialog {
    /deep/ .el-dialog__header {
      padding: 20px 20px 10px;
      text-align: center;
      
      .el-dialog__title {
        font-size: 18px;
        font-weight: 500;
        color: #333;
      }
    }
    
    /deep/ .el-dialog__body {
      padding: 20px 20px 30px;
    }
    
    .cancel-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      
      .warning-icon {
        font-size: 48px;
        color: #E6A23C;
        margin-bottom: 20px;
      }
      
      .warning-text {
        .title {
          font-size: 16px;
          font-weight: 500;
          color: #333;
          margin-bottom: 8px;
        }
        
        .desc {
          font-size: 14px;
          color: #909399;
        }
      }
    }
    
    /deep/ .el-dialog__footer {
      padding: 10px 20px 20px;
      text-align: center;
      
      .dialog-footer {
        .el-button {
          min-width: 100px;
          margin: 0 10px;
        }
      }
    }
  }

  // 移动端适配
  @media screen and (max-width: 768px) {
    .mutual-details {
      .basic-info {
        .review-status-bar {
          margin: 10px 0;
          padding: 10px;

          .reject-reason {
            margin-top: 6px;
            padding-top: 6px;
          }
        }
      }
    }
  }
}

.edit-dialog {
  :deep(.el-dialog) {
    min-width: 900px;
    
    .el-dialog__body {
      padding: 30px;
    }
  }
  
  .dialog-content {
    .form-header {
      margin-bottom: 30px;
      padding-bottom: 15px;
      border-bottom: 1px solid #ebeef5;
      
      i {
        font-size: 22px;
      }
      
      span {
        font-size: 16px;
      }
    }
    
    .edit-form {
      .el-row {
        margin-bottom: -15px;
      }
      
      .el-form-item {
        margin-bottom: 25px;
        
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .edit-dialog {
    :deep(.el-dialog) {
      width: 95% !important;
      min-width: auto;
      margin: 5vh auto !important;
      
      .el-dialog__body {
        padding: 20px;
      }
    }
    
    .dialog-content {
      .form-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
      }
      
      .edit-form {
        .el-form-item {
          margin-bottom: 15px;
        }
        
        .el-col {
          width: 100% !important;
        }
      }
    }
  }
}

.action-group {
  .action-item {
    &:hover {
      color: #409EFF;
      cursor: pointer;
    }
    
    &.forwarding {
      cursor: not-allowed;
      opacity: 0.7;
    }
  }
}

.audit-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 2001;
  
  .audit-form {
    max-width: 500px;
    margin: 0 auto;
    
    .el-form-item {
      margin-bottom: 15px;
      
      /deep/ .el-textarea__inner {
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 4px;
        background-color: #f8f9fb;
        border: 1px solid #e4e7ed;
        
        &:focus {
          background-color: #fff;
          border-color: #409EFF;
        }
        
        &::placeholder {
          color: #909399;
        }
      }
      
      /deep/ .el-textarea__count {
        color: #909399;
        font-size: 12px;
        background: transparent;
        padding: 0 5px;
      }
    }
    
    .audit-buttons {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin-top: 15px;
      
      .el-button {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 4px;
        
        &.el-button--success {
          &:hover, &:focus {
            color: #fff;
            background-color: #67c23a;
            border-color: #67c23a;
          }
        }
        
        &.el-button--danger {
          &:hover, &:focus {
            color: #fff;
            background-color: #f56c6c;
            border-color: #f56c6c;
          }
        }
        
        i {
          margin-right: 5px;
        }
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .audit-actions {
    padding: 12px 15px;
    
    .audit-form {
      .audit-buttons {
        gap: 15px;
        
        .el-button {
          flex: 1;
          min-width: auto;
          padding: 8px 15px;
        }
      }
    }
  }
}
</style>